﻿using System;
using System.Collections.Generic;

namespace DataCoreTechnologies.SqlServer
{
   /// <summary>
   /// Represents information a column that has been included in the specified index.
   /// </summary>
   public sealed class IndexColumn
   {
      #region Public
      //Properties
      /// <summary>
      /// A number that uniquely identifies this class instance.
      /// </summary>
      public Guid InstanceId { get; private set; }
      /// <summary>
      /// The index that this index column belongs to.
      /// </summary>
      public Index Index { get; internal set; }
      /// <summary>
      /// The column that this index column belongs to.
      /// </summary>
      public Column Column { get; internal set; }
      /// <summary>
      /// The order this column was added to the index.
      /// </summary>
      public int Order { get; internal set; }
      /// <summary>
      /// Indicator specifying whether this column is sorted descending in the index.
      /// </summary>
      public Boolean IsDescending { get; internal set; }
      /// <summary>
      /// Indicator specifying whether this column is included in the index.
      /// </summary>
      public Boolean IsIncluded { get; internal set; }
      #endregion
      #region Internal
      //Constructor
      /// <summary>
      /// Creates a index column and associates it with the index specified by the parameter.
      /// </summary>
      /// <param name="container"></param>
      internal IndexColumn(Index container)
      {
         InstanceId = System.Guid.NewGuid();
         Index = container;
      }
      #endregion
   }
}
